<template>
	<div class="test">
		<h2>注意：！！！ 这是测试路由，上线时要删掉</h2>
		<button @click="test">点我测试获取一下首页的三级分类</button>
	</div>
</template>

<script>
	import axios from 'axios'
	import nprogress from 'nprogress'
	import 'nprogress/nprogress.css'

	export default {
		name:'Test',
		methods: {
			test(){
				nprogress.start() //进度条走起
				axios.get('http://localhost:8080/sph/api/product/getBaseCategoryList').then(
					response => {
						nprogress.done() //进度条停止
						console.log('请求成功了',response.data)
					},
					error => {
						nprogress.done() //进度条停止
						console.log('请求失败了',error)
					}
				)
			}
		},
	}
</script>

<style lang="less" scoped>
	.test{
		background-color: gray;
		height: 200px;
	}
</style>